package tutorial.maim;

import java.io.IOException;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class Main extends Activity {
	
	private AudioRecorder ar;
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        ar = new AudioRecorder("/pruebasMias");
        
        Button start = (Button) this.findViewById(R.id.buttonStart);
        Button stop = (Button) this.findViewById(R.id.buttonStop);
        
        start.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				try {
					ar.start();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		});
        
        stop.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				try {
					ar.stop();
				} catch (IOException e) {
					e.printStackTrace();
				}
				
			}
		});
    }
}